package com.frinder.demo1;

import akka.actor.UntypedActor;

/**
 * Created by frinder on 2017/7/11.
 */
public class Greeter extends UntypedActor {

    public enum Msg {
        GREET, DONE
    }


    @Override
    public void onReceive(Object msg) throws Exception {
//        if (msg == Msg.GREET) {
//            System.out.println("Hello World!");
//            Thread.sleep(1000);
//            getSender().tell(Msg.DONE, getSelf());
//        } else {
//            unhandled(msg);
//        }

        System.out.println(getClass().getName() + ", " + msg);
        getSender().tell(msg, getSelf());

    }


}
